//
//  AddressMangerAddView.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/28.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "AddressMangerAddView.h"
#import "CreatNewAddressVC.h"

@interface AddressMangerAddView ()
@property (weak, nonatomic) IBOutlet UIButton *topBtn;


@end

@implementation AddressMangerAddView

- (void)awakeFromNib{
    
    [super awakeFromNib];
    
    self.backgroundColor = viewBgGrey;
    
    self.topBtn.backgroundColor = themeColor;
    
    self.topBtn.titleLabel.font = MYFONT(17);
    
    self.topBtn.layer.cornerRadius = 5;
    
    self.topBtn.layer.masksToBounds = YES;
    [self.topBtn setAttributedTitle:[self attributeString:@"+ 新增收货地址"] forState:UIControlStateNormal];
    [self.topBtn setAttributedTitle:[self attributeString:@"+ 新增收货地址"] forState:UIControlStateHighlighted];
    
    self.topBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 0, 9, 0);

    
}

- (NSMutableAttributedString *)attributeString:(NSString *)str{
    
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:str];
    
    [attr addAttribute:NSFontAttributeName value:MYFONT(16) range:NSMakeRange(0, str.length)];
    [attr addAttribute:NSFontAttributeName value:MYFONT(36) range:NSMakeRange(0, 1)];
    [attr addAttribute:NSBaselineOffsetAttributeName value:@(3) range:NSMakeRange(1,str.length - 1)];
    [attr addAttribute:NSForegroundColorAttributeName value:[UIColor whiteColor] range:NSMakeRange(0, str.length)];
    
       //    [attr addAttribute:NSKernAttributeName value:@(0.5f) range:NSMakeRange(0, str.length)];
    
    return attr;
    
    
}



- (IBAction)btnDidTap:(UIButton *)sender {
    
    CreatNewAddressVC *temp = [[CreatNewAddressVC alloc]init];
    
    [self.viewController.navigationController pushViewController:temp animated:YES];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
